﻿using System;
using System.Web.Script.Services;
using System.Web.Services;
using Dost.Khcn.Biz;

namespace Dost.Khcn.Web.ChuyenGia
{
    public partial class File : System.Web.UI.Page
    {
        private static ChuyenGiaFileBiz _chuyenGiaFileBiz;
        private static ChuyenGiaFileBiz ChuyenGiaFileManager
        {
            get { return _chuyenGiaFileBiz ?? (_chuyenGiaFileBiz = new ChuyenGiaFileBiz()); }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod(EnableSession = true)]
        public static object List(int chuyenGiaId)
        {
            var results = ChuyenGiaFileManager.GetFiles(chuyenGiaId);
            return new { Result = "OK", Records = results };
        }

        [WebMethod(EnableSession = true)]
        public static object Delete(int Id)
        {
            try
            {
                ChuyenGiaFileManager.Delete(Id);
                return new { Result = "OK" };
            }
            catch (Exception ex)
            {
                return new { Result = "ERROR", ex.Message };
            }
        }
    }
}